feat: add createX402PaymentHandler adapter for @acedatacloud/sdk#10
Merged
acedatacloud-dev merged 1 commit intomainfrom Apr 19, 2026
Merged
feat: add createX402PaymentHandler adapter for @acedatacloud/sdk#10acedatacloud-dev merged 1 commit intomainfrom
acedatacloud-dev merged 1 commit intomainfrom
Conversation
Germey
pushed a commit
that referenced
this pull request
Apr 19, 2026
Follow-up to #10. With createX402PaymentHandler now wired into the @acedatacloud/sdk transport, the standalone createX402Client + post/get wrapper in src/client.ts is redundant — everyone should go through the SDK, and the few places that need to bypass the SDK already import the low-level signSolanaPayment / signEVMPayment primitives directly. Changes: - delete src/client.ts (createX402Client, post, get, request) - drop X402ClientOptions + X402Response from src/types.ts - prune the top-level exports in src/index.ts - rewrite README.md as a single coherent doc (the old README had been stacked, with duplicate sections referencing createX402Client) - fix a stale console.log in scripts/test-e2e.ts Public API after this change: createX402PaymentHandler, X402PaymentHandlerOptions signSolanaPayment, signEVMPayment PaymentRequirement, PaymentRequiredResponse, X402PaymentEnvelope SolanaWalletAdapter, EVMProvider, SolanaPayload, EVMPayload, EVMAuthorization Build verified (npm run build → 0 errors).
acedatacloud-dev
added a commit
that referenced
this pull request
Apr 19, 2026
…11) Follow-up to #10. With createX402PaymentHandler now wired into the @acedatacloud/sdk transport, the standalone createX402Client + post/get wrapper in src/client.ts is redundant — everyone should go through the SDK, and the few places that need to bypass the SDK already import the low-level signSolanaPayment / signEVMPayment primitives directly. Changes: - delete src/client.ts (createX402Client, post, get, request) - drop X402ClientOptions + X402Response from src/types.ts - prune the top-level exports in src/index.ts - rewrite README.md as a single coherent doc (the old README had been stacked, with duplicate sections referencing createX402Client) - fix a stale console.log in scripts/test-e2e.ts Public API after this change: createX402PaymentHandler, X402PaymentHandlerOptions signSolanaPayment, signEVMPayment PaymentRequirement, PaymentRequiredResponse, X402PaymentEnvelope SolanaWalletAdapter, EVMProvider, SolanaPayload, EVMPayload, EVMAuthorization Build verified (npm run build → 0 errors).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
createX402PaymentHandler— a factory that returns apaymentHandlerfunction compatible with the new hook in@acedatacloud/sdk(see AceDataCloud/SDK PR). The adapter is also exported from the new@acedatacloud/x402-client/sdksubpath.Why
Previously this package reinvented its own fetch wrapper (
createX402Client,post,get) to do x402 flows, parallel to the official SDK. That meant users had to choose between "SDK with Bearer token" or "X402Client without task polling / streaming / typed errors."This change makes X402Client a small plugin for the SDK instead. The SDK keeps doing everything it already does for every AceDataCloud endpoint; X402Client only contributes the signing of the
X-Paymentheader.Usage
The existing low-level
createX402Clientis preserved for e2e scripts and quick experiments; the README now recommends the SDK path for production.Changes
src/sdkAdapter.tswithcreateX402PaymentHandlersrc/index.ts./sdksubpath export inpackage.jsonnpm run buildpassesCompanion PR in SDK: AceDataCloud/SDK#16 (opened just before this).